class A extends  Thread{
    String name;
    long SleepTime;
    public A(String name,long SleepTime){
        this.name=name;
        this.SleepTime=SleepTime;
    }
    public void run(){
        for(int i=0;i<20;i++){
            System.out.println(name+"===="+i);
        }
        try{
            sleep(SleepTime);//因为这里直接继承了Thread，所以可以不用类名调用
        }catch(InterruptedException e){}
    }
}
public class TestDemo{
    public static void main(String[] args){
        A a=new A("快线程",1000);
        A b=new A("慢线程",2000);
        a.start();
        b.start();
    }
}
